/*
 * Alexey Danchuk
 * This software is an implementation of the task from OOP module.
 */

/**
 * This class describes simple question type.
 *
 * @version 1.01 30 January 2013
 * @author Alexey Danchuk
 */
class SimpleQuestion extends Question {
	/**
	 * This variable holds the correct answer to the question.
	 */
	private String[] correctAnswers;

	public SimpleQuestion(String questionText, String[] ansersText,
						  String[] coorectAnsers) {
		super(questionText, ansersText);
		saveAnswer(coorectAnsers);
	}

	@Override
	protected int chekAnswer(String[] userAnswers) {
		if (userAnswers.length != correctAnswers.length) {
			return 0;
		} else {
			if (userAnswers[0].equals(correctAnswers[0])) {
				return 1;
			}
			return 0;
		}
	}

	@Override
	protected void saveAnswer(String[] answer) {
		correctAnswers = answer;
	}
}
